import Vue from 'vue'
import VueRouter from 'vue-router'
import Detail from '@/views/detail'
import Layout from '@/views/layout'
import Login from '@/views/login'
import Register from '@/views/register'
/* 二级路由 */
import Article from '@/views/layout/article'
import Collect from '@/views/layout/collect'
import Like from '@/views/layout/like'
import User from '@/views/layout/user'

Vue.use(VueRouter)

const router = new VueRouter({
  routes: [
    {
      path: '/',
      component: Layout,
      children: [
        {
          path: 'article',
          component: Article
        },
        {
          path: 'collect',
          component: Collect
        },
        {
          path: 'like',
          component: Like
        },
        {
          path: 'user',
          component: User
        }
      ]
    },
    {
      path: '/detail',
      component: Detail
    },
    {
      path: '/login',
      component: Login
    },
    {
      path: '/register',
      component: Register
    }
  ]
})

export default router
